﻿using System;
using System.Windows.Forms;

namespace melodyMe
{
    public partial class LyricsForm : Form
    {
        private string lyricsTitle, lyricsArtist;
 
        public LyricsForm(string lArtist, string lTitle)
        {
            InitializeComponent();

            lyricsTitle = lTitle;
            lyricsArtist = lArtist;
        }

        private void LyricsForm_Load(object sender, EventArgs e)
        {
            this.Text = lyricsArtist+" "+lyricsTitle;

            lyricsManager lyrics = new lyricsManager();
            string[] lyricArray = lyrics.InitaliseLyricsData(lyricsTitle, lyricsArtist);

            if (lyricArray == null)
            { MessageBox.Show("No Lyrics Found for " + lyricsTitle); this.Close(); return; }

            //Write the lyrics array to the form.
            foreach (string lyric in lyricArray)
            { txtLyricsTextbox.Text += lyric+Environment.NewLine; }

            this.ActiveControl = lblDummy;
        }
    }
}
